Component({
    properties: {
        goodsData: {
            type: null
        },
        cardid: {
            type: null
        }
    },
    lifetimes: {
        attached: function() {}
    },
    data: {
        activitys1: [],
        activitys2: [],
        showLoading: !0,
        imgCount: 0,
        colOneHeight: 0,
        colTwoHeight: 0
    },
    methods: {
        toVideo: function(t) {
            var a = t.currentTarget.dataset.item, i = this.data.goodsData.findIndex(function(t, i, o) {
                return t.id === a.id;
            });
            i = Math.ceil((i + 1) / 12), this.data.cardid ? wx.navigateTo({
                url: "/packageC/video_goods/VideoDetail/VideoDetail?vid=" + a.id + "&page=" + i + "&from=card&card_id=" + this.data.cardid
            }) : wx.navigateTo({
                url: "/packageC/video_goods/VideoDetail/VideoDetail?vid=" + a.id
            });
        },
        onImageLoad: function(t) {
            this.setData({
                showLoading: !1
            });
            for (var a = t.currentTarget.id, i = t.detail.width, o = t.detail.height, d = this.data.goodsData, e = null, s = i / o, h = 0; h < d.length; h++) if (d[h].id == a) {
                e = d[h];
                break;
            }
            var n = this.data, g = n.colTwoHeight, c = n.colOneHeight;
            this.data.imgCount += 1;
            var r = this.data.activitys1, l = this.data.activitys2;
            c <= g ? (this.data.colOneHeight += 176 / s + 60, r.push(e)) : (this.data.colTwoHeight += 176 / s + 60, 
            l.push(e));
            var u = {
                activitys1: r,
                activitys2: l
            };
            this.data.imgCount >= this.data.goodsData.length && this.setData({
                showLoading: !0
            }), this.setData(u);
        },
        onImgError: function() {
            this.data.imgCount += 1, this.data.imgCount >= this.data.goodsData.length && this.setData({
                showLoading: !0
            });
        }
    }
});